import multiprocessing
import time


def func():
    print('函数正在运行')
    time.sleep(3)
    print('函数运行完成')


def func2():
    print('函数正在运行')
    time.sleep(3)
    print('函数运行完成')


if __name__ == '__main__':
    from time import time
    a = time()

    p = multiprocessing.Process(target=func)
    p.start()

    p1 = multiprocessing.Process(target=func2)
    p1.start()


    p.join()
    p1.join()

    b = time()
    print(b-a)
    # 4.526044607162476
